\(\int \csc (e+f x) (a+b \sin (e+f x)) \, dx\) [153]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 17, antiderivative size = 17 \[ \int \csc (e+f x) (a+b \sin (e+f x)) \, dx=b x-\frac {a \text {arctanh}(\cos (e+f x))}{f} \]

[Out]

b*x-a*arctanh(cos(f*x+e))/f

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {2814, 3855} \[ \int \csc (e+f x) (a+b \sin (e+f x)) \, dx=b x-\frac {a \text {arctanh}(\cos (e+f x))}{f} \]

[In]

Int[Csc[e + f*x]*(a + b*Sin[e + f*x]),x]

[Out]

b*x - (a*ArcTanh[Cos[e + f*x]])/f

Rule 2814

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*(x/d)
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = b x+a \int \csc (e+f x) \, dx \\ & = b x-\frac {a \text {arctanh}(\cos (e+f x))}{f} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(43\) vs. \(2(17)=34\).

Time = 0.03 (sec) , antiderivative size = 43, normalized size of antiderivative = 2.53 \[ \int \csc (e+f x) (a+b \sin (e+f x)) \, dx=b x-\frac {a \log \left (\cos \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{f}+\frac {a \log \left (\sin \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{f} \]

[In]

Integrate[Csc[e + f*x]*(a + b*Sin[e + f*x]),x]

[Out]

b*x - (a*Log[Cos[e/2 + (f*x)/2]])/f + (a*Log[Sin[e/2 + (f*x)/2]])/f

Maple [A] (verified)

Time = 0.61 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.29

method result size
parallelrisch \(\frac {b x f +a \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}\) \(22\)
derivativedivides \(\frac {a \ln \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )\right )+b \left (f x +e \right )}{f}\) \(31\)
default \(\frac {a \ln \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )\right )+b \left (f x +e \right )}{f}\) \(31\)
risch \(b x +\frac {a \ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )}{f}-\frac {a \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}{f}\) \(40\)
norman \(\frac {b x +b x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )}+\frac {a \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}\) \(51\)

[In]

int(csc(f*x+e)*(a+b*sin(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

(b*x*f+a*ln(tan(1/2*f*x+1/2*e)))/f

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 38 vs. \(2 (17) = 34\).

Time = 0.32 (sec) , antiderivative size = 38, normalized size of antiderivative = 2.24 \[ \int \csc (e+f x) (a+b \sin (e+f x)) \, dx=\frac {2 \, b f x - a \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + a \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right )}{2 \, f} \]

[In]

integrate(csc(f*x+e)*(a+b*sin(f*x+e)),x, algorithm="fricas")

[Out]

1/2*(2*b*f*x - a*log(1/2*cos(f*x + e) + 1/2) + a*log(-1/2*cos(f*x + e) + 1/2))/f

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 48 vs. \(2 (14) = 28\).

Time = 2.59 (sec) , antiderivative size = 51, normalized size of antiderivative = 3.00 \[ \int \csc (e+f x) (a+b \sin (e+f x)) \, dx=a \left (\begin {cases} \frac {x \cot {\left (e \right )} \csc {\left (e \right )}}{\cot {\left (e \right )} + \csc {\left (e \right )}} + \frac {x \csc ^{2}{\left (e \right )}}{\cot {\left (e \right )} + \csc {\left (e \right )}} & \text {for}\: f = 0 \\- \frac {\log {\left (\cot {\left (e + f x \right )} + \csc {\left (e + f x \right )} \right )}}{f} & \text {otherwise} \end {cases}\right ) + b x \]

[In]

integrate(csc(f*x+e)*(a+b*sin(f*x+e)),x)

[Out]

a*Piecewise((x*cot(e)*csc(e)/(cot(e) + csc(e)) + x*csc(e)**2/(cot(e) + csc(e)), Eq(f, 0)), (-log(cot(e + f*x)
+ csc(e + f*x))/f, True)) + b*x

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.71 \[ \int \csc (e+f x) (a+b \sin (e+f x)) \, dx=\frac {{\left (f x + e\right )} b - a \log \left (\cot \left (f x + e\right ) + \csc \left (f x + e\right )\right )}{f} \]

[In]

integrate(csc(f*x+e)*(a+b*sin(f*x+e)),x, algorithm="maxima")

[Out]

((f*x + e)*b - a*log(cot(f*x + e) + csc(f*x + e)))/f

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.47 \[ \int \csc (e+f x) (a+b \sin (e+f x)) \, dx=\frac {{\left (f x + e\right )} b + a \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) \right |}\right )}{f} \]

[In]

integrate(csc(f*x+e)*(a+b*sin(f*x+e)),x, algorithm="giac")

[Out]

((f*x + e)*b + a*log(abs(tan(1/2*f*x + 1/2*e))))/f

Mupad [B] (verification not implemented)

Time = 6.29 (sec) , antiderivative size = 85, normalized size of antiderivative = 5.00 \[ \int \csc (e+f x) (a+b \sin (e+f x)) \, dx=\frac {a\,\ln \left (\frac {\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )}{f}+\frac {2\,b\,\mathrm {atan}\left (\frac {b\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )+a\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )}{a\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )-b\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )}{f} \]

[In]

int((a + b*sin(e + f*x))/sin(e + f*x),x)

[Out]

(a*log(sin(e/2 + (f*x)/2)/cos(e/2 + (f*x)/2)))/f + (2*b*atan((b*cos(e/2 + (f*x)/2) + a*sin(e/2 + (f*x)/2))/(a*
cos(e/2 + (f*x)/2) - b*sin(e/2 + (f*x)/2))))/f